package com.gitee.huanminabc.validate;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @description:  最小为0 最大为Long.MAX_VALUE
 * @author: huanmin
 * @create: 2025-04-23 16:16
 **/
@Documented
@Constraint(validatedBy = { MoneyLegalValidator.class })
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE })
@Retention(RUNTIME)
public @interface MoneyLegal {
    String message() default "金额不合法";

    Class<?>[] groups() default { };

    Class<? extends Payload>[] payload() default { };
    double max() default Double.MAX_VALUE;
    double min() default 0;
}
